package org.NooLab.itexx.app.gui;

import java.awt.AlphaComposite;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JButton;



class TransparentButton extends JButton {
	
	public TransparentButton(String text) {
		super(text);
		setOpaque(false);
	}

	public void paint(Graphics g) {
		Graphics2D g2 = (Graphics2D) g.create();
		g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
		/*
		 *  SRC_OVER =  SRC_ATOP
		 *  SRC_IN does not work, dark gray 
		 *  SRC_OUT,DST_ATOP,DST_IN all black
		 *  
		 *  DST_OUT very dark gray, text visible
		 *  
		 *  DST_OVER no button visible, just the pane below
		 */
		super.paint(g2);
		g2.dispose();
	}
}